Skip to content

Tab strip UX: close chip, drag reorder, context menu, Ctrl+Tab setting - #65

Merged
aamott merged 9 commits into
mainfrom
ui-tab-close-button
Oct 17, 2026
Merged

aamott merged 9 commits into
mainfrom
ui-tab-close-button

Conversation

@aamott

@aamott aamott commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Tab close button is now a visible square hover chip matching the title bar's other chips — fixed 1.6rem target, accent fill on hover, sitting closer to the tab's right edge.
  • Drag to reorder tabs: pointer-driven (6px threshold so clicks stay clicks), live displacement preview, edge auto-scroll, Escape cancel; drops go through a new reorder reducer action that leaves tab ids, selection, and location history untouched. "Move tab left/right" palette commands cover keyboard reordering.
  • Tab context menu on right-click: Close (dirty-guard path), Close other tabs / Close tabs to the right (new closeMultiple action; self-stubs when a dirty tab is in the target set), Copy path for file-backed tabs. Reveal in explorer and Pin tab are stubbed disabled ("Not implemented yet").
  • Ctrl+Tab cycling now runs through a tested helper with an app-scoped editor.tabCycleOrder setting; both modes currently cycle in strip order — last-visited is registered but explicitly falls back until an activation-recency ledger exists (story filed in plans/ui-shell/).
  • Resize handles (left/right docks): invisible 4px overhang each side gives a 9px grab area with no layout shift; the line thickens on hover.
  • Minimum popout width lowered to 148px (2/3 of the old 224px), clamped in both renderer and native save path.
  • Explorer header: New note / New folder buttons always visible; the hover-reveal utility is removed.

Test plan

  • pnpm vitest run in apps/desktop — 2,360 tests pass (incl. new tabReorder/tabClose/tabCycle/useTabStripDrag/TitleBar menu suites)
  • cargo test in src-tauri — 599 pass
  • pnpm lint + pnpm typecheck clean; full pnpm qa green
  • Manual: drag tabs across a overflowing strip, right-click menu on dirty tabs, Ctrl+Tab/Ctrl+Shift+Tab in the Tauri app

Generated with Devin

The close affordance was a bare glyph with uneven padding — hard to
hit and invisible as a target. It now matches the title bar's other
square chips: fixed 1.6rem rounded square, accent fill on hover,
sitting a step from the tab's right edge.
Preview tab displacement and scroll at strip edges without changing navigation history. Expose palette commands for keyboard reordering and preserve click behavior below the drag threshold.
Keep Ctrl+Tab cycling in strip order through a tested helper and app setting. Register last-visited mode as an explicit fallback until a reliable activation-recency ledger exists.
The 1px line was the whole hitbox — nearly impossible to grab. An
invisible 4px overhang into each panel centers a 9px target on the
edge without shifting layout, and the line thickens on hover so the
target is visible as well as hittable.
224px was more floor than narrow windows need; 148px (two thirds)
lets a slim explorer or right dock coexist with a wider editor.
Clamped in both the renderer and the native save path so the two
cannot drift.
Hover-reveal hid the two most common explorer actions behind an
invisible state machine. They render unconditionally now, and the
tn-explorer-create-reveal utility is deleted with them.
Right-clicking a tab opens a pointer-placed menu (shared Menu surface)
with Close routed through the existing dirty-guard flow, plus Close
others / Close tabs to the right implemented as a closeMultiple reducer
action in a sibling module since tabModel.ts is at the file-size cap.
Copy path works for file-backed tabs; Reveal in explorer and Pin tab are
rendered disabled as not implemented — neither capability exists yet.
Multi-close items stub themselves likewise when a dirty tab sits in the
target set, since no multi-tab confirmation flow exists.
The breadcrumb/save strip and the settings bar used a content-driven
min-h-8 while the popout headers beside them are fixed h-9, so the
two rows next to each other never agreed. Both bars are h-9 now.
The scope union is only consumed inside tabClose.ts; the exported
type read as dead surface in CI's knip check.
@aamott
aamott enabled auto-merge (squash) October 17, 2026 17:52
@aamott
aamott merged commit 97ac63d into main Oct 17, 2026
13 checks passed
@aamott
aamott deleted the ui-tab-close-button branch October 17, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant